import { request } from '@pkg/request/src';

export enum Api {
  page = '/employeeServer/page',
  employeeServerList = '/employeeServer/list',
  get = '/employeeServer/get',
  save = '/employeeServer/save',
  update = '/employeeServer/update',
  remove = '/employeeServer/remove',
}

/**
 * 保存或更新
 * @param params
 * @param isUpdate
 */
export const saveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.update : Api.save;
  return request.post({ url: url, params });
};

/**
 * 查询详情
 * @param params
 */
export const getBusEmployeeServer = (params) => {
  return request.get(
    { url: Api.get, params },
    {
      errorMessageMode: 'none',
      successMessageMode: 'none',
    },
  );
};

/**
 * 销售核销服务列表
 * @param params
 */
export const employeeServerList = (params) => {
  return request.get({ url: Api.employeeServerList, params });
};
